package com.foreknow.demo9Exercise5;

public class Hero extends ActionCharacter implements CanSwim,CanFly {
    private String name;
    public Hero(){

    }

    @Override
    public void fight(String emp) {
        System.out.println(emp + "fight");
    }

    @Override
    public void fly() {
        System.out.println(name + "fly");
    }

    @Override
    public void swim() {
        System.out.println(name + "swim");
    }

    public static void main(String[] args) {
        Hero hero = new Hero();
        hero.name = "小王";
        hero.swim();
        hero.fly();
        hero.fight("小王");
    }
}
